//模块的引入
let express = require('express')
let pageController = require('./controller/pageController')
let userController = require('./controller/userController')
//引入路由模块
let router = express.Router()
//前端页面的路径匹配
router.get('/',pageController.indexPage)
.get('/detail',pageController.detailsPage)
.get('/list',pageController.listPage)

//后台登录页面的路径匹配
.post('/login',userController.afterLogin)
// .post('/login',userController.afterLogin)
//后端页面的路径匹配
.get('/admin/categories',pageController.categories)
.get('/admin/comments',pageController.comments)
.get('/admin/index',pageController.index)
.get('/login',pageController.login)
.get('/admin/navmenus',pageController.navMenus)
.get('/admin/passwordreset',pageController.password)
.get('/admin/postadd',pageController.postadd)
.get('/admin/post',pageController.post)
.get('/admin/sliders',pageController.slides)
.get('/admin/users',pageController.users)
.get('/admin/profile',pageController.profile)
.get('/admin/settings',pageController.settings)

//匹配页面退出的路由
.get('/loginOut',userController.loginOut)
//暴露路由模块
module.exports=router